package com.study.composite.demo.safe;

public class Test {
    public static void main(String[] args) {
        File qq = new File("QQ");
        File wx = new File("微信");

        Folder office = new Folder("办公软件",2);
        File word = new File("word");
        File excel= new File("excel");
        File ppt = new File("ppt");

        office.addChild(word);
        office.addChild(excel);
        office.addChild(ppt);

        Folder root = new Folder("D盘",1);
        root.addChild(qq);
        root.addChild(wx);
        root.addChild(office);

        root.show();

        root.list();
    }
}
